package cn.drenal.capcap.entity;

import cn.drenal.capcap.entity.base.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tangzc.autotable.annotation.ColumnComment;
import com.tangzc.autotable.annotation.ColumnDefault;
import com.tangzc.autotable.annotation.ColumnNotNull;
import com.tangzc.mpe.autotable.annotation.*;
import com.tangzc.mpe.processer.annotation.AutoDefine;
import com.tangzc.mpe.processer.annotation.AutoMapper;
import com.tangzc.mpe.processer.annotation.AutoRepository;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 轮播图表
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper
@Table(comment = "轮播图表")
public class Banner extends BaseEntity {
    @ColumnComment("主键")
    @ColumnId(mode = IdType.AUTO)
    private Long id;

    @ColumnComment("标题")
    @ColumnNotNull
    private String title;

    @ColumnComment("图片路径")
    @ColumnNotNull
    private String imageUrl;

    @ColumnComment("链接地址")
    private String linkUrl;

    @ColumnComment("链接类型：0-无链接，1-内部链接，2-外部链接")
    @ColumnNotNull
    @ColumnDefault("0")
    private Integer linkType;

    @ColumnComment("排序")
    @ColumnNotNull
    @ColumnDefault("0")
    private Integer sort;

    @ColumnComment("状态：0-禁用，1-启用")
    @ColumnNotNull
    @ColumnDefault("1")
    private Integer status;

    @ColumnComment("关联ID，如作品ID、活动ID等")
    private String relatedId;

    @ColumnComment("关联类型：0-无关联，1-作品，2-活动")
    @ColumnNotNull
    @ColumnDefault("0")
    private Integer relatedType;
}